package cgl.narada.test.security;

import cgl.narada.service.security.securityprovider.CertificateManager;
import cgl.narada.service.security.securityprovider.ROOTSecurityProvider;

/**
 * Generates various keys <br>
 * Created on Sep 9, 2005
 * 
 * @author Harshawardhan Gadgil (hgadgil@grids.ucs.indiana.edu)
 */
public class KeysGenerator {

    public static void main(String[] args) {
        CertificateManager certMan = new CertificateManager();
//        certMan.init("/home/hgadgil/tmp/narada/keystore/NBSecurityTest.keys",
//                null);

         certMan.init("c:\\Home\\tmp\\narada\\keystore\\NBSecurityTest.keys",
         null);

        ROOTSecurityProvider.GenerateROOTCertificate(certMan);

        String[] DNList = { "c1", "CN=client1,OU=CGL,O=IU,L=Bloomington,C=US",
                "c2", "CN=client2,OU=CGL,O=IU,L=Bloomington,C=US", "c3",
                "CN=client3,OU=DistLab,O=NYC,L=NewYork,C=US", "c4",
                "CN=client4,OU=DistLab,O=NYC,L=NewYork,C=US", "kmc1",
                "CN=KMC,OU=CGL,O=IU,L=Bloomington,C=US", "tdn",
                "CN=TDN,OU=CGL,O=IU,L=Bloomington,C=US" };

        for (int i = 0; i < DNList.length; i += 2) {
            ROOTSecurityProvider.IssueSignedCertificate(certMan, DNList[i],
                    DNList[i + 1], "10");
        }

    }

}
